package com.xmg.mgrsite.base;

import com.xmg.p2p.base.query.IplogQueryObject;
import com.xmg.p2p.base.service.IplogService;
import com.xmg.p2p.base.util.UserContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @BelongsProject: jinrong-website
 * @BelongsPackage: com.xmg.mgrsite.base
 * @author: Andy
 * @date: 2021.3.9 16:32
 * @Description: 登录日志控制器
 * @since JDK 1.8
 */
@Controller
public class IplogController {
    @Autowired
    private IplogService iplogService;

    /**
     * 登录记录列表
     */
    @RequestMapping("ipLog")
    public String iplogList(@ModelAttribute("qo") IplogQueryObject qo,
                            Model model){
        qo.setUsername(UserContext.getCurrent().getUsername());
        model.addAttribute("pageResult",this.iplogService.query(qo));
        return "ipLog/list";

    }
}
